package com.mua.test.user.controller;

import com.mua.test.user.entity.User;
import com.mua.test.user.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * @author JiangLan
 * @since 2024/4/19 14:52
 */
@RestController
@RequestMapping("user")
public class UserController {
    @Resource
    private UserService userService;

    @GetMapping("/list")
    @PreAuthorize("hasAuthority('USER_LIST')")
    public List<User> list(){
        return userService.list();
    }

}
